\hypertarget{class_variant}{}\section{Variant Class Reference}
\label{class_variant}\index{Variant@{Variant}}


This class is designed to facilitate the passing of simple type parameters such as qlonglong, double, int, and Q\+String to the C\+S\+TL (C++ Server Pages Standard Tags Library).  




{\ttfamily \#include $<$variant.\+h$>$}



Inheritance diagram for Variant\+:
% FIG 0
\subsection*{Public Slots}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{class_variant_a832bfdf3d791497b776c67b322fec871}{to\+Int} (bool $\ast$ok=nullptr) const noexcept
\begin{DoxyCompactList}\small\item\em Returns the variant as an int if the variant has user\+Type() Q\+Meta\+Type\+::\+Int, Q\+Meta\+Type\+::\+Bool, Q\+Meta\+Type\+::\+Q\+Byte\+Array, Q\+Meta\+Type\+::\+Q\+Char, Q\+Meta\+Type\+::\+Double, Q\+Meta\+Type\+::\+Long\+Long, Q\+Meta\+Type\+::\+Q\+String, Q\+Meta\+Type\+::\+U\+Int, or Q\+Meta\+Type\+::\+U\+Long\+Long; otherwise returns 0. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_ad1797f20d9396d3ddaf24b16453e3534}\label{class_variant_ad1797f20d9396d3ddaf24b16453e3534}} 
void \hyperlink{class_variant_ad1797f20d9396d3ddaf24b16453e3534}{set\+Int} (int value) noexcept
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an int value. \end{DoxyCompactList}\item 
double \hyperlink{class_variant_a17e4fd1648eb98fdc0a68302c392a216}{to\+Double} (bool $\ast$ok=nullptr) const noexcept
\begin{DoxyCompactList}\small\item\em Returns the variant as a double if the variant has user\+Type() Q\+Meta\+Type\+::\+Double, Q\+Meta\+Type\+::\+Float, Q\+Meta\+Type\+::\+Bool, Q\+Meta\+Type\+::\+Q\+Byte\+Array, Q\+Meta\+Type\+::\+Int, Q\+Meta\+Type\+::\+Long\+Long, Q\+Meta\+Type\+::\+Q\+String, Q\+Meta\+Type\+::\+U\+Int, or Q\+Meta\+Type\+::\+U\+Long\+Long; otherwise returns 0.\+0. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a6af0bb75e0612a13cb0880f0cec9a870}\label{class_variant_a6af0bb75e0612a13cb0880f0cec9a870}} 
void \hyperlink{class_variant_a6af0bb75e0612a13cb0880f0cec9a870}{set\+Double} (double value) noexcept
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an double value. \end{DoxyCompactList}\item 
qlonglong \hyperlink{class_variant_a4181b7ff9d27ae4936a6e91c9a9d7e26}{to\+Long\+Long} (bool $\ast$ok=nullptr) const noexcept
\begin{DoxyCompactList}\small\item\em Returns the variant as a long long int if the variant has user\+Type() Q\+Meta\+Type\+::\+Long\+Long, Q\+Meta\+Type\+::\+Bool, Q\+Meta\+Type\+::\+Q\+Byte\+Array, Q\+Meta\+Type\+::\+Q\+Char, Q\+Meta\+Type\+::\+Double, Q\+Meta\+Type\+::\+Int, Q\+Meta\+Type\+::\+Q\+String, Q\+Meta\+Type\+::\+U\+Int, or Q\+Meta\+Type\+::\+U\+Long\+Long; otherwise returns 0. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a415098d546cf5f269de7ef5c5c438304}\label{class_variant_a415098d546cf5f269de7ef5c5c438304}} 
void \hyperlink{class_variant_a415098d546cf5f269de7ef5c5c438304}{set\+Long\+Long} (qlonglong value) noexcept
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an qlonglong value. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a40530eedbdc0f3bad04df67febbc09de}\label{class_variant_a40530eedbdc0f3bad04df67febbc09de}} 
Q\+String \hyperlink{class_variant_a40530eedbdc0f3bad04df67febbc09de}{to\+String} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the variant as a Q\+String if the variant has user\+Type() Q\+Meta\+Type\+::\+Q\+String, Q\+Meta\+Type\+::\+Bool, Q\+Meta\+Type\+::\+Q\+Byte\+Array, Q\+Meta\+Type\+::\+Q\+Char, Q\+Meta\+Type\+::\+Q\+Date, Q\+Meta\+Type\+::\+Q\+Date\+Time, Q\+Meta\+Type\+::\+Double, Q\+Meta\+Type\+::\+Int, Q\+Meta\+Type\+::\+Long\+Long, Q\+Meta\+Type\+::\+Q\+String\+List, Q\+Meta\+Type\+::\+Q\+Time, Q\+Meta\+Type\+::\+U\+Int, or Q\+Meta\+Type\+::\+U\+Long\+Long; otherwise returns an empty string. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a0ca6fc641562de93db2490eb2a1e7d0e}\label{class_variant_a0ca6fc641562de93db2490eb2a1e7d0e}} 
void \hyperlink{class_variant_a0ca6fc641562de93db2490eb2a1e7d0e}{set\+String} (const Q\+String \&value) noexcept
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an Q\+String value. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_variant_a594b84b7c7a7e997aac3354bbdaa2d97}\label{class_variant_a594b84b7c7a7e997aac3354bbdaa2d97}} 
\hyperlink{class_variant_a594b84b7c7a7e997aac3354bbdaa2d97}{Variant} ()=default
\begin{DoxyCompactList}\small\item\em Constructs an invalid variant. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a1015564e64eb9bc9ce894fb1f98b6e36}\label{class_variant_a1015564e64eb9bc9ce894fb1f98b6e36}} 
\hyperlink{class_variant_a1015564e64eb9bc9ce894fb1f98b6e36}{Variant} (int value)
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an integer value. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a7e7d9a46e166e059ce75b76b92b11457}\label{class_variant_a7e7d9a46e166e059ce75b76b92b11457}} 
\hyperlink{class_variant_a7e7d9a46e166e059ce75b76b92b11457}{Variant} (double value)
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an double value. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a6f86cea152e761f48700e41f210fe251}\label{class_variant_a6f86cea152e761f48700e41f210fe251}} 
\hyperlink{class_variant_a6f86cea152e761f48700e41f210fe251}{Variant} (qlonglong value)
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an qlonglong value. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_a2a2d8b7cc035142a795f86d481adde0c}\label{class_variant_a2a2d8b7cc035142a795f86d481adde0c}} 
\hyperlink{class_variant_a2a2d8b7cc035142a795f86d481adde0c}{Variant} (const Q\+String \&value)
\begin{DoxyCompactList}\small\item\em Constructs a new variant with an Q\+String value. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{class_variant_af11a005d444e0879b6a479bca786b19e}\label{class_variant_af11a005d444e0879b6a479bca786b19e}} 
\hyperlink{class_variant_af11a005d444e0879b6a479bca786b19e}{Variant} (const Q\+Byte\+Array \&value)
\begin{DoxyCompactList}\small\item\em Constructs a new variant and converts to Q\+String. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class is designed to facilitate the passing of simple type parameters such as qlonglong, double, int, and Q\+String to the C\+S\+TL (C++ Server Pages Standard Tags Library). 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_variant_a17e4fd1648eb98fdc0a68302c392a216}\label{class_variant_a17e4fd1648eb98fdc0a68302c392a216}} 
\index{Variant@{Variant}!to\+Double@{to\+Double}}
\index{to\+Double@{to\+Double}!Variant@{Variant}}
\subsubsection{\texorpdfstring{to\+Double}{toDouble}}
{\footnotesize\ttfamily double Variant\+::to\+Double (\begin{DoxyParamCaption}\item[{bool $\ast$}]{ok = {\ttfamily nullptr} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [slot]}, {\ttfamily [noexcept]}}



Returns the variant as a double if the variant has user\+Type() Q\+Meta\+Type\+::\+Double, Q\+Meta\+Type\+::\+Float, Q\+Meta\+Type\+::\+Bool, Q\+Meta\+Type\+::\+Q\+Byte\+Array, Q\+Meta\+Type\+::\+Int, Q\+Meta\+Type\+::\+Long\+Long, Q\+Meta\+Type\+::\+Q\+String, Q\+Meta\+Type\+::\+U\+Int, or Q\+Meta\+Type\+::\+U\+Long\+Long; otherwise returns 0.\+0. 


\begin{DoxyParams}{Parameters}
{\em If} & ok is non-\/null\+: $\ast$ok is set to true if the value could be converted to a double; otherwise $\ast$ok is set to false. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_variant_a832bfdf3d791497b776c67b322fec871}\label{class_variant_a832bfdf3d791497b776c67b322fec871}} 
\index{Variant@{Variant}!to\+Int@{to\+Int}}
\index{to\+Int@{to\+Int}!Variant@{Variant}}
\subsubsection{\texorpdfstring{to\+Int}{toInt}}
{\footnotesize\ttfamily int Variant\+::to\+Int (\begin{DoxyParamCaption}\item[{bool $\ast$}]{ok = {\ttfamily nullptr} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [slot]}, {\ttfamily [noexcept]}}



Returns the variant as an int if the variant has user\+Type() Q\+Meta\+Type\+::\+Int, Q\+Meta\+Type\+::\+Bool, Q\+Meta\+Type\+::\+Q\+Byte\+Array, Q\+Meta\+Type\+::\+Q\+Char, Q\+Meta\+Type\+::\+Double, Q\+Meta\+Type\+::\+Long\+Long, Q\+Meta\+Type\+::\+Q\+String, Q\+Meta\+Type\+::\+U\+Int, or Q\+Meta\+Type\+::\+U\+Long\+Long; otherwise returns 0. 

\begin{DoxyWarning}{Warning}
\+: If the value is convertible to a Q\+Meta\+Type\+::\+Long\+Long but is too large to be represented in an int, the resulting arithmetic overflow will not be reflected in ok. A simple workaround is to use Q\+String\+::to\+Int() 
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em If} & ok is non-\/null\+: $\ast$ok is set to true if the value could be converted to an int; otherwise $\ast$ok is set to false. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_variant_a4181b7ff9d27ae4936a6e91c9a9d7e26}\label{class_variant_a4181b7ff9d27ae4936a6e91c9a9d7e26}} 
\index{Variant@{Variant}!to\+Long\+Long@{to\+Long\+Long}}
\index{to\+Long\+Long@{to\+Long\+Long}!Variant@{Variant}}
\subsubsection{\texorpdfstring{to\+Long\+Long}{toLongLong}}
{\footnotesize\ttfamily qlonglong Variant\+::to\+Long\+Long (\begin{DoxyParamCaption}\item[{bool $\ast$}]{ok = {\ttfamily nullptr} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [slot]}, {\ttfamily [noexcept]}}



Returns the variant as a long long int if the variant has user\+Type() Q\+Meta\+Type\+::\+Long\+Long, Q\+Meta\+Type\+::\+Bool, Q\+Meta\+Type\+::\+Q\+Byte\+Array, Q\+Meta\+Type\+::\+Q\+Char, Q\+Meta\+Type\+::\+Double, Q\+Meta\+Type\+::\+Int, Q\+Meta\+Type\+::\+Q\+String, Q\+Meta\+Type\+::\+U\+Int, or Q\+Meta\+Type\+::\+U\+Long\+Long; otherwise returns 0. 


\begin{DoxyParams}{Parameters}
{\em If} & ok is non-\/null\+: $\ast$ok is set to true if the value could be converted to an int; otherwise $\ast$ok is set to false. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/home/herik/\+C\+P\+P\+Web\+Framework/\+C\+P\+P\+Web\+Framework/cwf/variant.\+h\end{DoxyCompactItemize}
